<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
    <%@include file="../system/head.jsp"%>
    <title>我的收藏</title>

    <link rel="stylesheet" type="text/css" href="/static/css/webbase.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/pages-seckillOrder.css" />

</head>
<style>
    .goods_name{
        width:200px;
        word-break:break-all;
        display:-webkit-box;
        -webkit-line-clamp:1;
        -webkit-box-orient:vertical;
        overflow:hidden;
    }
</style>
<body>
<!-- 头部栏位 -->
<!--页面顶部-->
<%@include file="../system/header.jsp"%>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript">
    $(function(){
        $("#service").hover(function(){
            $(".service").show();
        },function(){
            $(".service").hide();
        });
        $("#shopcar").hover(function(){
            $("#shopcarlist").show();
        },function(){
            $("#shopcarlist").hide();
        });

    })
</script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/jquery-placeholder/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/widget/nav.js"></script>
</body>
<!--header-->
<div id="account">
    <div class="py-container">
        <div class="yui3-g home">
            <!--左侧列表-->
            <div class="yui3-u-1-6 list">
                <div class="list-items">
                    <dl>
                        <dt><i>·</i> 订单中心</dt>
                        <dd ><a href="${pageContext.request.contextPath}/system/toHome?username=${Username}&currentPage=1" >我的订单</a></dd>
                        <dd><a href="${pageContext.request.contextPath}/system/toOrderList?username=${Username}&order_status=0&currentPage=1" >待付款</a></dd>
                        <dd><a href="${pageContext.request.contextPath}/system/toOrderList?username=${Username}&order_status=1&currentPage=1"  >待发货</a></dd>
                        <dd><a href="${pageContext.request.contextPath}/system/toOrderList?username=${Username}&order_status=2&currentPage=1" >待收货</a></dd>
                    </dl>
                    <dl>
                        <dt><i>·</i> 我的中心</dt>
                        <dd><a href="${pageContext.request.contextPath}/goods/toCollect?username=${Username}&currentPage=1" class="list-active">我的收藏</a></dd>
                    </dl>
                    <dl>
                        <dt><i>·</i> 设置</dt>
                        <dd><a href="${pageContext.request.contextPath}/system/toAddress?username=${Username}"  >地址管理</a></dd>                    </dl>
                </div>
            </div>
            <!--右侧主内容-->
            <div class="yui3-u-5-6 goods">
                <div class="body">
                    <h4>收藏的商品</h4>
                    <div class="goods-list">
                        <ul class="yui3-g"  id="goods-list">
                            <c:forEach var="goods" items="${page.list}">
                            <li class="yui3-u-1-4">
                                <div class="list-wrap">
                                    <div class="p-img"><img src=${goods.goods.image1} alt=''></div>
                                    <div class="price"><strong><em>¥</em> <i>${goods.goods.goods_price}</i></strong></div>
                                    <div class="attr"><em class="goods_name">${goods.goods.goods_name}</em></div>
                                    <div class="operate">
                                        <a href="${pageContext.request.contextPath}/goods/addCart?userName=${Username}&goods_id=${goods.goods.goods_id}" target="_blank" class="sui-btn btn-bordered btn-danger">加入购物车</a>
                                        <a style="margin-left: 53px" href="${pageContext.request.contextPath}/goods/deleteCollect?username=${Username}&goods_id=${goods.goods.goods_id}&currentPage=${page.currentPage}"class="sui-btn btn-bordered btn-danger">取消收藏</a>
                                    </div>
                                </div>
                            </li>
                            </c:forEach>
                        </ul>
                        <%--分页开始--%>
                        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/page.css">
                        <script src="${pageContext.request.contextPath}/static/js/jquery.z-pager.js" type="text/javascript" charset="utf-8"></script>
                        <div id="pager" class="pager clearfix" style="float: right">
                        </div>
                        <script type="text/javascript">
                            $("#pager").zPager({
                                totalData: ${page.totalCount},
                                current: ${page.currentPage},
                                pageCount: ${page.totalPage}, //总页数
                                pageData: ${page.pageSizes},
                                minPage: 1,
                                prevBtn: 'pg-prev', //上一页按钮
                                nextBtn: 'pg-next', //下一页按钮
                                btnShow: true,
                                ajaxSetData: false
                            });

                            function currentPage(currentPage){
                                /*
                                    触发页码数位置： Page/js/jquery.z-pager.js 64行
                                */
                                console.log("当前页码数：" + currentPage);
                                if(currentPage !== ${page.currentPage}){
                                    location.href = "${pageContext.request.contextPath}/goods/toCollect?username=${Username}&currentPage="+currentPage+"";
                                }
                            }

                        </script>
                        <%--分页结束--%>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 底部栏位 -->
<!--页面底部-->
<%@include file="../system/Footer.jsp"%>
<!--页面底部END-->
    <!-- 楼层位置 -->
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/model/cartModel.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/czFunction.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/jquery.easing/jquery.easing.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/sui/sui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/pages/index.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/widget/cartPanelView.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/widget/jquery.autocomplete.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/widget/nav.js"></script>
<!--页面底部END-->
undefined

</html>